package net.bolue.sysmng.entry;

/**
 * 表字段
 * @author Administrator
 *
 */
public class DbColumn {
	
	/**
	 * 表名
	 */
	private String tableName;
	
	/**
	 * 字段名
	 */
	private String name;
	
	/**
	 * 类型
	 */
	private Integer type;
	
	/**
	 * 长度
	 */
	private Integer length;
	
	/**
	 * 是否可为空
	 */
	private boolean notNull = false;
	
	/**
	 * 是否主键
	 */
	private boolean key = false;
	
	/**
	 * 默认值
	 */
	private String defaultValue;
	
	/**
	 * 备注
	 */
	private String comment;
	
	public DbColumn(){
		
	}
	
	public DbColumn(String name, Integer type, Integer length) {
		super();
		this.name = name;
		this.type = type;
		this.length = length;
	}
	
	public DbColumn(String name, Integer type, Integer length,
			boolean notNull, boolean key) {
		super();
		this.name = name;
		this.type = type;
		this.length = length;
		this.notNull = notNull;
		this.key = key;
	}
	
	public DbColumn(String name, Integer type, Integer length,
			boolean notNull, boolean key, String defaultValue, String comment) {
		super();
		this.name = name;
		this.type = type;
		this.length = length;
		this.notNull = notNull;
		this.key = key;
		this.defaultValue = defaultValue;
		this.comment = comment;
	}

	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public Integer getLength() {
		return length;
	}

	public void setLength(Integer length) {
		this.length = length;
	}

	public boolean isNotNull() {
		return notNull;
	}

	public void setNotNull(boolean notNull) {
		this.notNull = notNull;
	}

	public boolean isKey() {
		return key;
	}

	public void setKey(boolean key) {
		this.key = key;
	}

	public String getDefaultValue() {
		return defaultValue;
	}

	public void setDefaultValue(String defaultValue) {
		this.defaultValue = defaultValue;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}
	
}
